<%@ page import="org.apache.struts.action.Action"%>
<%@ page import = "java.util.ArrayList" %>
<%@ page import = "com.mbbmap.util.Constants" %>
<%@ page import = "com.mbbmap.security.dao.*" %>

<%
	ArrayList secGroupAccessList = (ArrayList) session.getAttribute(Constants.LOGON_ACCESS_LIST);
	SecUserDao oSecUserDao = (SecUserDao) session.getAttribute(Constants.LOGGED_USER);

	String sUserName = oSecUserDao.getUserName();
	String lastLogonDateTime = (String) session.getAttribute(Constants.LAST_LOGON_DATETIME);

	String selected = "home";
	int iManualCP = 0; //MAN000
	int iSecMan = 0; //SEC000
	int iFAQ = 0; //FAQ000
	int iExempt = 0; //EXE000
	int iChangePW = 0; //CPW000
	int iRefMan = 0; //RFM000
	int iUserGuid = 0; //USG000
	int iTech = 0; //TEC000
	int iApp0 = 0; //APP000
	int iApp1 = 0; //APP001
	int iApp4 = 0; //APP004
	int iApp5 = 0; //APP005
	int iApp6 = 0; //APP006
	int iApp7 = 0; //APP007
	int iApp8 = 0; //APP008
	int iApp9 = 0; //APP009
	int iApp10 = 0; //APP010

	for (int i = 0; i < secGroupAccessList.size(); i++) {
		SecAccessDao secaccessDao = (SecAccessDao) secGroupAccessList.get(i);
		String strModuleCode = secaccessDao.getModuleCode();
		if (strModuleCode.equals("MAN000"))
			iManualCP = 1;
		if (strModuleCode.equals("SEC000"))
			iSecMan = 1;
		if (strModuleCode.equals("FAQ000"))
			iFAQ = 1;
		if (strModuleCode.equals("EXE000"))
			iExempt = 1;
		if (strModuleCode.equals("CPW000"))
			iChangePW = 1;
		if (strModuleCode.equals("RFM000"))
			iRefMan = 1;
		if (strModuleCode.equals("USG000"))
			iUserGuid = 1;
		if (strModuleCode.equals("TEC000"))
			iTech = 1;
		if (strModuleCode.equals("APP000")) {
			if (secaccessDao.getWriteFlag().equals("01")) {
				iApp0 = 1;
			}

			if (secaccessDao.getReadFlag().equals("01")) {
				iApp0 = 2;
			}

			if (secaccessDao.getUpdateFlag().equals("01")) {
				iApp0 = 3;
			}
		}
		if (strModuleCode.equals("APP001")) {
			iApp1 = 1;
		}
		if (strModuleCode.equals("APP004")) {
			iApp4 = 1;
		}
		if (strModuleCode.equals("APP005")) {
			iApp5 = 1;
		}
		if (strModuleCode.equals("APP006")) {
			iApp6 = 1;
		}
		if (strModuleCode.equals("APP007")) {
			iApp7 = 1;
		}
		if (strModuleCode.equals("APP008")) {
			iApp8 = 1;
		}
		if (strModuleCode.equals("APP009")) {
			iApp9 = 1;
		}
		if (strModuleCode.equals("APP010")) {
			iApp10 = 1;
		}
	}
%>
<link href="resource/style.css" rel="stylesheet" type="text/css">
	<script type="text/javascript">
	    window.history.forward();
	    function noBack() { window.history.forward(); }
	</script>
<style type="text/css"></style></head>

<body class="home" onload="noBack();" onpageshow="if (event.persisted) noBack();" onunload="">
	<a name="top"></a>
	

<!-- Header -->
<%@ include file="Header.jsp" %>	
<!-- End Header -->

<!--  
<form name="HomeForm" method="post">
-->
	<div id="bgWrapper">
		<div id="container">

			<div id="titleBar">
				<ul class="topBar">
					<li class="goBackBt"><a href="<%=request.getContextPath()%>/CheckUserLogon.do?dispatch=homePage"></a></li>
					<li>
					  <h1>Home</h1></li>
				</ul>
			</div>

			<div id="fullcontent">
				

<!-- Root Navigation -->
<%@ include file="RootNavigation.jsp" %>	
<!-- End Root Navigation -->

					<div id="contentRightIn">
						<table border="0" cellpadding="0" cellspacing="0" width="600">
							<tbody>
								<tr>
									<td>
										<div style="width: auto; height: auto; padding: 12px 20px; margin: 0 0 5px 0; display: block; font-size: 20px; font-weight: bold; color: #ffb606;">
											What to do:
										</div>
								<tr>
									<td width="50%">
										<div class="listingBox"
											<%=iApp1 == 1 ? "" : "style='display:none'"%>>
											<form id="NewApp" name="NewApp"
												action="<%=request.getContextPath()%>/NewApp.do?dispatch=init" method="post">
												<input type="hidden" name="<%=Constants.TOKEN_KEY%>" value="<%=session.getAttribute(Action.TRANSACTION_TOKEN_KEY)%>">
												<a href="#"
													onclick="document.getElementById('NewApp').submit()">
													<h3>New Application</h3> 
													<br /> Create new cases.<br /> <br />
												</a>
											</form>
										</div>
									</td>
									<td width="50%">
										<div class="listingBox"
											<%=iApp5 == 1 ? "" : "style='display:none'"%>>
											<form id="PendingApp" name="PendingApp"
												action="<%=request.getContextPath()%>/PendingApp.do?dispatch=init" method="post">
												<input type="hidden" name="<%=Constants.TOKEN_KEY%>" value="<%=session.getAttribute(Action.TRANSACTION_TOKEN_KEY)%>">
												<a href="#"
													onclick="document.getElementById('PendingApp').submit()">
													<h3>Pending Submission</h3> 
													<br /> View Pending Submission cases.<br /> <br />
												</a>
											</form>
										</div>
									</td>
								</tr>
								<tr>
									<td width="50%">
										<div class="listingBox"
											<%=iApp6 == 1 ? "" : "style='display:none'"%>>
											<form id="MyApp" name="MyApp"
												action="<%=request.getContextPath()%>/MyApp.do?dispatch=init" method="post">
												<input type="hidden" name="<%=Constants.TOKEN_KEY%>" value="<%=session.getAttribute(Action.TRANSACTION_TOKEN_KEY)%>">
												<a href="#"
													onclick="document.getElementById('MyApp').submit()">
													<h3>Pending Completion</h3> 
													<br /> View Pending completion cases.<br /> <br />
												</a>
											</form>
										</div>
									</td>
									<td width="50%">
										<div class="listingBox"
											<%=iApp7 == 1 ? "" : "style='display:none'"%>>
											<form id="TypeApp" name="TypeApp"
												action="<%=request.getContextPath()%>/TypeApp.do?dispatch=init" method="post">
												<input type="hidden" name="<%=Constants.TOKEN_KEY%>" value="<%=session.getAttribute(Action.TRANSACTION_TOKEN_KEY)%>">
												<a href="#"
													onclick="document.getElementById('TypeApp').submit()">
													<h3>Search</h3> 
													<br /> Search cases.<br /> <br />
												</a>
											</form>
										</div>
									</td>
								</tr>
								<tr>
									<td width="50%">
										<div class="listingBox"
											<%=iApp4 == 1 ? "" : "style='display:none'"%>>
											<form id="NewAppVendor" name="NewAppVendor"
												action="<%=request.getContextPath()%>/NewApp.do?dispatch=terminal_vendor_installation" method="post">
												<input type="hidden" name="<%=Constants.TOKEN_KEY%>" value="<%=session.getAttribute(Action.TRANSACTION_TOKEN_KEY)%>">
												<a href="#"
													onclick="document.getElementById('NewAppVendor').submit()">
													<h3>Terminal Vendor Installation</h3> 
													<br /> View Terminal Vendor Installation.<br /> <br />
												</a>
											</form>
										</div>
									</td>
									<td width="50%">
										<div class="listingBox"
											<%=iApp8 == 1 ? "" : "style='display:none'"%>>
											<form id="Notification" name="Notification"
												action="<%=request.getContextPath()%>/Notification.do?dispatch=init" method="post">
												<input type="hidden" name="<%=Constants.TOKEN_KEY%>" value="<%=session.getAttribute(Action.TRANSACTION_TOKEN_KEY)%>">
												<a href="#"
													onclick="document.getElementById('Notification').submit()">
													<h3>To Do List</h3> 
													<br /> View To Do List.<br /> <br />
												</a>
											</form>
										</div>
									</td>
								</tr>
								<tr>
									<td width="50%">
										<div class="listingBox"
											<%=iApp9 == 1 ? "" : "style='display:none'"%>>
											<form id="VisaVMTSBatch" name="VisaVMTSBatch"
												action="<%=request.getContextPath()%>/VisaVMTSBatch.do?dispatch=init" method="post">
												<input type="hidden" name="<%=Constants.TOKEN_KEY%>" value="<%=session.getAttribute(Action.TRANSACTION_TOKEN_KEY)%>">
												<a href="#"
													onclick="document.getElementById('VisaVMTSBatch').submit()">
													<h3>Visa VMTS Batch</h3> 
													<br /> View Visa VMTS Batch.<br /> <br />
												</a>
											</form>
										</div>
									</td>
									<td width="50%">
										<div class="listingBox"
											<%=iApp10 == 1 ? "" : "style='display:none'"%>>
											<form id="Report" name="Report"
												action="<%=request.getContextPath()%>/Report.do?dispatch=init" method="post">
												<input type="hidden" name="<%=Constants.TOKEN_KEY%>" value="<%=session.getAttribute(Action.TRANSACTION_TOKEN_KEY)%>">
												<a href="#"
													onclick="document.getElementById('Report').submit()">
													<h3>Report</h3> 
													<br /> View Report.<br /> <br />
												</a>
											</form>
										</div>
									</td>
								</tr>
								<tr>
									<td width="50%"><div class="listingBox"
											<%=iSecMan == 1 ? "" : "style='display:none'"%>>
											<form id="SecurityManagement" name="SecurityManagement"
												action="<%=request.getContextPath()%>/ShowSecurityHome.do?dispatch=init" method="post">
												<input type="hidden" name="<%=Constants.TOKEN_KEY%>" value="<%=session.getAttribute(Action.TRANSACTION_TOKEN_KEY)%>">
												<a href="#"
													onclick="document.getElementById('SecurityManagement').submit()">
													<h3>Security Management</h3> 
													<br /> This module allows user to configure modules, groups, access rights and users creation.
												</a>
											</form>
										</div></td>
									<td width="50%">
										<div class="listingBox"
											<%=iChangePW == 1 ? "" : "style='display:none'"%>>
											<form id="ChangePassword" name="ChangePassword"
												action="<%=request.getContextPath()%>/UserAction.do?dispatch=changePwd" method="post">
												<input type="hidden" name="<%=Constants.TOKEN_KEY%>" value="<%=session.getAttribute(Action.TRANSACTION_TOKEN_KEY)%>">
												<a href="#"
													onclick="document.getElementById('ChangePassword').submit()">
													<h3>Change Password</h3> 
													<br /> Allows user to change password.<br /> <br />
												</a>
											</form>
										</div>
									</td>
								</tr>
								<tr>
									<td width="50%">
										<div class="listingBox"
											<%=iFAQ == 1 ? "" : "style='display:none'"%>>
											<a href="<%=request.getContextPath()%>/Faq.do?dispatch=init"
												onclick="overlay();">
												<h3>FAQs</h3> 
												<br />Allows user to view the common asked
												questions
											</a>
										</div>
									</td>
									<td width="50%">
										<div class="listingBox"
											<%=iUserGuid == 1 ? "" : "style='display:none'"%>>
											<a
												href="<%=request.getContextPath()%>/UserGuide.do?dispatch=init"
												onclick="overlay();">
												<h3>User Guide</h3> 
												<br />Provide user to download the user guide document.
											</a>
										</div>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				
<!-- Footer -->
<%@ include file="Footer.jsp" %>
<!-- End Footer -->

		</div>
	</div>

<!-- 
</form>
 -->